package com.english.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.english.entity.Appointment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 预约数据访问层
 *
 * @author wlq
 * @since 2025-08-04
 */
@Mapper
public interface AppointmentMapper extends BaseMapper<Appointment> {

    /**
     * 根据学生ID统计预约次数
     * @param studentId 学生ID
     * @return 预约次数
     */
    @Select("SELECT COUNT(*) FROM appointment WHERE student_id = #{studentId}")
    Integer countByStudentId(@Param("studentId") Long studentId);
}
